
package juc.mythread.tools;

public class SleepTools {
    /**
     * 线程休眠指定毫秒数
     * @param millis 休眠时间(毫秒)
     */
    public static void ms(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw new RuntimeException("Sleep interrupted", e);
        }
    }

    /**
     * 线程休眠指定秒数
     * @param seconds 休眠时间(秒)
     */

    public static void second(long seconds) {
        ms(seconds * 1000);
    }
}
